<template>
	<div >
		<div class="docbox" v-if="find" id="printMe">
			<div class="title">{{document.title}}</div>
			<div class="subtitle">
				<span>文号：<span>{{document.doc_no}}</span></span>
				<span>状态：<span>{{document.status}}</span></span>
				<span>发文日期：<span>{{document.publish_date}}</span></span>
			</div>
			<div class="docmain" v-html="content">
				{{content}}
			</div>
		</div>
	 	<div  v-if="!find">
	 		没有找到
	 	</div>
	</div>
</template>
<script>
import axios from 'axios'
import storage from '../../../storage/index'

  export default {
    name: 'PrintDoc',
    data() {
    	return{
    		document:{},
    		content:'',
    		find:false
    	}
    },
    methods:{
    	getPrintDoc(){
    	  console.log('getPrintDoc2')
    		let id = storage.get('docno')
			let url = '/law/detail?id='+id
		    axios.get(url,{
				id
			}).then((res)=>{
				res = res.data
				if (res.status==200) {
					this.find=true
					this.document = res.data
					this.content = res.data.content
				}else{
					this.find=false
				}
			})		    	
    	}
    },
    mounted () {
	    this.getPrintDoc()

	}  
  }
</script>

<style scoped>
	.docbox{
		height: 398px;
		overflow: auto;
		border-top:2px solid #A3C7E2;
	}
	.title{
		text-align: center;
		font-size: 20px;
		color: #FF0000;
		font-weight: 800;
		margin:5px 0 30px 0;
	}
	.subtitle{
		text-align: center;
		margin-bottom: 20px;
	}
	.docmain{
		border-top:1px dashed #000;
		padding-top: 20px;
	}
</style>